home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 2 / AACD 2.iso / AACD / WebSites / Sites / Wirenet / files / Wirenet15.lzx / Updates / SendEvents < prev    next >
Text File  |  1978-03-29  |  2KB  |  63 lines

  1. /* $VER: SendEvents 1.5 (01.09.96) (c) Neil Bothwick */
  2. /*                                                   */
  3. /* Check if there are any outstanding events and if  */
  4. /* so send them                                      */
  5.  
  6. /* Change these to suit your setup */
  7.  
  8. SystemName = 'Wirenet'                  /* The name of your Internet system in Thor */
  9. MaxTries   = 1                          /* Maximum number of retries */
  10. Logging    = 0                          /* Turn on logging, only use with Thor 2.3 and above */
  11. LogFile    = 'UUSpool:Connect.log'
  12.  
  13. /* Don't change anything below here */
  14.  
  15. EVE_DOWNLOAD     =  4
  16. EVE_UPLOAD       =  5
  17.  
  18. address command
  19.  
  20. if ~show('p', 'BBSREAD') then do
  21.     "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
  22.     "WaitForPort BBSREAD"
  23.     end
  24.  
  25. if ~show('L','rexxdossupport.library') then
  26.     call addlib('rexxdossupport.library',0,-30)
  27.  
  28. CmdStr = GetVar('Thor/ThorPath')||'bin/SendTCP BBSNAME' SystemName 'MAILSERVER $SMTPSERVER NEWSSERVER $NEWSSERVER PUBSCREEN Workbench'
  29. if exists('ENV:FTPSERVER') then CmdStr = CmdStr 'AMINETSERVER $FTPSERVER'
  30. if exists('ENV:FTPBASE') then CmdStr = CmdStr 'AMINETBASEDIR $FTPBASE'
  31. if Logging = 1 then CmdStr = CmdStr 'LOGFILE' LogFile
  32.  
  33. do Try = 1 to MaxTries
  34.     if ActiveEvents() = 0 then leave
  35.     CmdStr
  36.     end
  37.  
  38. If ActiveEvents() > 0 then ExitMsg('SendTCP failed')
  39.  
  40. exit
  41.  
  42.  
  43. ActiveEvents:
  44.     address BBSREAD
  45.     ActiveCount = 0
  46.     GETBBSDATA SystemName SystemData
  47.     do EventNo=SystemData.FIRSTEVENT to SystemData.LASTEVENT
  48.         drop EventData.
  49.         drop EventTags.
  50.         READBREVENT '"'SystemName'"' eventnr EventNo datastem EventData tagsstem EventTags
  51.         EventFlags = c2x(EventData.FLAGS)
  52.         if EventFlags = 0 | EventFlags = 8 then return 1
  53.         end
  54.     address command
  55.     return 0
  56.  
  57. ExitMsg:
  58.     parse arg ErrMsg
  59.     say(ErrMsg)
  60.     exit
  61.     return
  62.  
  63.